﻿<UserControl x:Class="XmlEditor.Presentation.Views.SearchView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:XmlEditor.Presentation.Helpers" 
             local:AttachedProperties.RegisterCommandBindings="{Binding CommandBindings}"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <ListView Grid.Row="0"
                  x:Name="FoundNodes"
                  ItemsSource="{Binding FoundNodes}"
                  SelectedItem="{Binding SelectedFoundNode}"
                  SelectionChanged="ListViewSelectionChanged">
            <ListView.Resources>
                <Style TargetType="{x:Type ListView}">
                    <Setter Property="ItemContainerStyle">
                        <Setter.Value>
                            <Style TargetType="ListViewItem">
                                <Setter Property="VerticalContentAlignment"
                                        Value="Top" />
                            </Style>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListView.Resources>
            <ListView.View>
                <GridView>
                    <GridView.Columns>
                        <GridViewColumn Header="Name"
                                        DisplayMemberBinding="{Binding Name}"
                                        Width="200" />
                        <GridViewColumn Header="Value"
                                        DisplayMemberBinding="{Binding Value}"
                                        Width="400" />
                    </GridView.Columns>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</UserControl>
